import { defHttp } from '@/utils/http/axios'

enum Api {
  getGroupTree = `/monitor/group/devideTree`,
  addGroup = '/monitor/group/add',
  updateGroup = '/monitor/group/update',
  deleteGroup = '/monitor/group/delete',
  getDevice = '/monitor/list',
  updateGroupDevice = '/monitor/updateGroupDevice',
  getGroupDevice = '/monitor/listByGroupId',
  getStream ='/monitor/camera/stream/preview'
}


export const addGroup = (data) => defHttp.post({ url: Api.addGroup, data })
export const updateGroup = (data) => defHttp.post({ url: Api.updateGroup, data })
export const getGroupTree = () => defHttp.get({ url: Api.getGroupTree })
export const deleteGroup = (data) => defHttp.post({ url: Api.deleteGroup, data })
export const getDevice = () => defHttp.get({ url: Api.getDevice })
export const updateGropuDevice = (data) => defHttp.post({ url: Api.updateGroupDevice,data })
export const getGroupDevice = (params) => defHttp.get({ url: Api.getGroupDevice, params })
export const getStream = (data) => defHttp.post({ url: Api.getStream, data })